package proxy.staticProxy;

/**
 * 使用聚合的方式
 */
public class CarTimeProxy implements MoveAble{
    private MoveAble car;

    public CarTimeProxy(MoveAble car) {
        super();
        this.car = car;
    }

    @Override
    public void move() {
        long startTime = System.currentTimeMillis();
        System.out.println("汽车开始行驶");
        car.move();
        long endTime = System.currentTimeMillis();
        System.out.println("汽车结束行驶。。。行驶时间："+ (endTime - startTime)+ "毫秒");
    }
}
